#include <iostream>

#include <fstream>

using namespace std;

int main(int argc, char const *argv[])
{
  ofstream out_file; //  只写

  out_file.open("./file.txt", ios::out);

  if (out_file.is_open())
  {

    cout << "start to write file\n";

    out_file << "This is a line.\n";
    out_file << "This is another line.\n";
    out_file << "fuck you\n";
    out_file.close();
  }
  else
    cout << "Unable to open file";

  return 0;
}
